package jp.sourceforge.akjrcp.ffmpeg;

import java.io.File;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


public abstract class AdvancedAudioFFMpegPreference extends FFMpegPreference{
public static Log log = LogFactory.getLog(AdvancedAudioFFMpegPreference.class);
private boolean forceConvert=false;
private int defaultBitrate=128;
private int convertChannel=2;
private int convertFramerate=44100;
private int convertBitrate=128;
private boolean useCopy=true;

private String[] ignoreBitrateFormat={"wav"};
public int getConvertBitrate() {
	return convertBitrate;
}
public void setConvertBitrate(int convertBitrate) {
	this.convertBitrate = convertBitrate;
}
public int getConvertChannel() {
	return convertChannel;
}
public void setConvertChannel(int convertChannel) {
	this.convertChannel = convertChannel;
}
public int getConvertFramerate() {
	return convertFramerate;
}
public void setConvertFramerate(int convertFramerate) {
	this.convertFramerate = convertFramerate;
}
public int getDefaultBitrate() {
	return defaultBitrate;
}
public void setDefaultBitrate(int defaultBitrate) {
	this.defaultBitrate = defaultBitrate;
}
public boolean isForceConvert() {
	return forceConvert;
}
public void setForceConvert(boolean forceConvert) {
	this.forceConvert = forceConvert;
}
public boolean isUseCopy() {
	return useCopy;
}
public void setUseCopy(boolean useCopy) {
	this.useCopy = useCopy;
}

//should use defalut bitrate
protected boolean isCanUseBitrate(String extension){
	for (int i = 0; i < ignoreBitrateFormat.length; i++) {
		if(extension.toLowerCase().equals(ignoreBitrateFormat[i].toLowerCase())){
			return false;
		}
	}
	return true;
}
public abstract  String[] customToCommand(String input,String avsInput,String output);


/*
public String[] toCommand(String input,String avsInput,String output){
return customToCommand(input,avsInput,output);
}
*/

public String[] getIgnoreBitrateFormat() {
	return ignoreBitrateFormat;
}
public void setIgnoreBitrateFormat(String[] ignoreBitrateFormat) {
	this.ignoreBitrateFormat = ignoreBitrateFormat;
}

}
